/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package imat;

import se.chalmers.ait.dat215.project.ShoppingCart;
import se.chalmers.ait.dat215.project.ShoppingItem;

/**
 *
 * @author Andreas
 */
public class SavedShoppingCart extends ShoppingCart {

    public SavedShoppingCart(ShoppingCart cart) {
        super();

        for (ShoppingItem item : cart.getItems()) {
            ShoppingItem copyItem = new ShoppingItem(item.getProduct());
            copyItem.setAmount(item.getAmount());
            addItem(copyItem);
        }
    }

    public SavedShoppingCart() {
        super();
    }

}
